package com.leaves.leetcode.array.t454_4SumⅡ;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.leaves.leetcode.UnitTesting;

import java.util.List;

public class T454Main extends UnitTesting<List<int[]>, Integer> {

    Solution solution = new Solution();

    @Override
    protected void generateTestData() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            testDataList.add(createTestData(
                    objectMapper.readValue("[[1,2],[-2,-1],[-1,2],[0,2]]", new TypeReference<List<int[]>>() {}),
                    2
            ));
            testDataList.add(createTestData(
                    objectMapper.readValue("[[0],[0],[0],[0]]", new TypeReference<List<int[]>>() {}),
                    1
            ));

        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public Integer run(List<int[]> inputData) {
        return solution.fourSumCount(inputData.get(0), inputData.get(1), inputData.get(2), inputData.get(3));
    }
}
